package com.zhuiYun.project.api.dynamicstate.controller;

import com.zhuiYun.project.api.dynamicstate.service.DynamicStateService;
import com.zhuiYun.project.api.shoppingcart.model.ShoppingCartModel;
import com.zhuiYun.project.common.errorCode.CommonException;
import com.zhuiYun.project.common.response.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName:DynamicStateController
 * @descriptions: 主题controller
 * @Author: zq
 * @Date 2023/4/18 16:10
 */
@RestController
@Api(tags = "主题管理")
@RequestMapping("/dynamicState")
@Slf4j
public class DynamicStateController {
    @Resource
    DynamicStateService dynamicStateService;

    /**
     * @description: 主题管理查询方法
     * @author: zq
     * @date: 2023/4/18 16:16
     * @param: []
     * @return: com.zhuiYun.project.common.response.CommonResult
    **/
    @GetMapping("/dynamicStateByState")
    @ApiOperation(value = "主题管理查询方法")
    public CommonResult dynamicStateByState() throws CommonException {
        log.info("主题管理查询方法");
        CommonResult commonResult = dynamicStateService.dynamicStateByState();
        return commonResult;
    }

    @GetMapping("/getMerchantInfo")
    @ApiOperation(value = "获取商家信息方法")
    public CommonResult getMerchantInfo(@RequestParam(defaultValue = "1") int id) {
        log.info("获取商家信息方法");
        CommonResult commonResult = dynamicStateService.getMerchantInfo(id);
        return commonResult;
    }
}
